<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Date Picker</title>
<script src="./calendar/js_test/prototype.js" type="text/javascript"></script>
<link href="./calendar/css/basic.css" media="screen" rel="Stylesheet" type="text/css" />
<script src="./calendar/public/javascripts/calendar_date_select/calendar_date_select.js" type="text/javascript"></script>
<script src="./calendar/public/javascripts/calendar_date_select/format_finnish.js" type="text/javascript"></script>
<link href="./calendar/css/default.css" media="screen" rel="Stylesheet" type="text/css" />

</head>

<body>
<p>
<input type="text" name="temp" />
<input id="p_date" name="p_date" type="text" /> <img alt="Calendar" onclick="new CalendarDateSelect( $(this).previous(), {year_range:10} );" src="images/calendar.gif" style="border:0px; cursor:pointer;" />
</p>
</body>
</html>
<?
include("functions/functions.php");
include("inc/config.php");
require_once 'MDB2.php';
$dsn = $params[dsn];

$mdb2 =& MDB2::factory($dsn);

if (PEAR::isError($mdb2)) {
    echo ($mdb2->getMessage().' - '.$mdb2->getUserinfo());
}

$query ='SELECT * FROM er_emergency_relief';

// run the query and get a result handler
$result = $mdb2->query($query);

// check if the query was executed properly
if (PEAR::isError($result)) {
    echo ($result->getMessage().' - '.$result->getUserinfo());
    exit();
}

// lets just get row:0 and free the result
$array = $result->fetchRow();
$result->free();
var_dump($array);
?>